import request from '@/config/axios'

// 风险辨识内容 VO
export interface RiskIdentifyTargetContentVO {
  id: number // 主键id
  riskTypeInfoId: number // 风险点id
  identifyId: number // 风险辨识id
  identifyInstanceId: number // 风险辨识实例id
  riskTargetId: number // 对象id
  identifyContent: string // 辨识内容
  identifyContentCode: string // 辨识内容编码
  hazard: string // 危害
  projectSolution: string // 工程解决方案
  managerSolution: string // 管理解决方案
  selfSolution: string // 个人解决方案
  trainEduSolution: string // 培训教育解决方案
  badSolution: string // 应急解决方案
}

// 风险辨识内容 API
export const RiskIdentifyTargetContentApi = {
  // 查询风险辨识内容分页
  getRiskIdentifyTargetContentPage: async (params: any) => {
    return await request.get({ url: `/zjyj/risk-identify-target-content/page`, params })
  },

  // 查询风险辨识内容详情
  getRiskIdentifyTargetContent: async (id: number) => {
    return await request.get({ url: `/zjyj/risk-identify-target-content/get?id=` + id })
  },

  // 新增风险辨识内容
  createRiskIdentifyTargetContent: async (data: RiskIdentifyTargetContentVO) => {
    return await request.post({ url: `/zjyj/risk-identify-target-content/create`, data })
  },

  // 修改风险辨识内容
  updateRiskIdentifyTargetContent: async (data: RiskIdentifyTargetContentVO) => {
    return await request.put({ url: `/zjyj/risk-identify-target-content/update`, data })
  },

  // 删除风险辨识内容
  deleteRiskIdentifyTargetContent: async (id: number) => {
    return await request.delete({ url: `/zjyj/risk-identify-target-content/delete?id=` + id })
  },

  // 导出风险辨识内容 Excel
  exportRiskIdentifyTargetContent: async (params) => {
    return await request.download({ url: `/zjyj/risk-identify-target-content/export-excel`, params })
  }
}